<f:view xmlns="http://www.w3.org/1999/xhtml"
	 xmlns:f="http://java.sun.com/jsf/core"
	 xmlns:h="http://java.sun.com/jsf/html"
	 xmlns:p="http://primefaces.org/ui"
	 xmlns:pm="http://primefaces.org/mobile"
	 contentType="text/html">
	 <f:metadata>
		<f:event listener="#{pageBean.check}" type="preRenderView"></f:event>
	</f:metadata>
 <pm:page title="Add/Edit Grocery Item">

  <h:form>
 <pm:view id="grocerylistadd">
 <pm:header title="Add/Edit Grocery Item"/>

 <pm:content>

 <h3>Grocery List Item Attributes</h3>
 <table style="width:100%">
 <tr>
 <td>
 Name:
 </td>
 <td>
 <p:inputText value="#{groceryListBean.itemToAdd.name}"/>
 </td>
 </tr>
 <tr>
 <td>Category:
 </td>
 <td>
 <p:inputText value="#{groceryListBean.itemToAdd.category}"/>
 </td>
 </tr>
 <tr>
 <td>
 Volume:
 </td>
 <td>
 <p:inputText id="volume" value="#{groceryListBean.itemToAdd.quantity}"/>
 </td>
 </tr>
 <tr>
 <td>
 Unit:
 </td>
 <td>
 <p:inputText value="#{groceryListBean.itemToAdd.measurement}"/>
 </td>
 </tr>
 </table>
	
	<br/><br/><center>
	<pm:buttonGroup orientation="horizontal">
	<p:commandButton value="Save Changes" action="#{groceryListBean.addItemToList}">
		<f:param name="groceryList" value="#{groceryListBean.session.currentGroceryList.groceryListId}"/>
	</p:commandButton>
	<p:commandButton value="Cancel" action="grocerylistcancelitem"/>
	</pm:buttonGroup>
	</center>

 
 </pm:content>
 </pm:view>
  </h:form>
 </pm:page>

</f:view>
	